Public Class adm_edituser
    Inherits System.Web.UI.Page
    'Protected WithEvents TheHeader1 As adm_header
    Public Msg As String
    Public aUserSession(13) As String
    Protected WithEvents sUID As System.Web.UI.WebControls.TextBox
    Protected WithEvents sVID As System.Web.UI.WebControls.TextBox
    Protected WithEvents company As System.Web.UI.WebControls.TextBox
    Protected WithEvents password As System.Web.UI.WebControls.TextBox
    Protected WithEvents firstname As System.Web.UI.WebControls.TextBox
    Protected WithEvents lastname As System.Web.UI.WebControls.TextBox
    Protected WithEvents location As System.Web.UI.WebControls.TextBox
    Protected WithEvents Phone As System.Web.UI.WebControls.TextBox
    Protected WithEvents Ext As System.Web.UI.WebControls.TextBox
    Protected WithEvents Email As System.Web.UI.WebControls.TextBox
    Protected WithEvents btnUpdate As System.Web.UI.WebControls.Button
    Protected WithEvents btnUnloc As System.Web.UI.WebControls.Button
    Protected WithEvents btnCancel As System.Web.UI.WebControls.Button
    Protected WithEvents btnEditTerm As System.Web.UI.WebControls.Button
    Protected WithEvents btnEditRights As System.Web.UI.WebControls.Button
    Protected WithEvents ch As System.Web.UI.WebControls.CheckBox
    Public objvalid As New gaValidation
    Public imgpath, currtURL As String
#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
       
        objValid.getURL(Request.Url.ToString, imgpath, currtURL)

        ''--- PASSED IN FROM ADM_FINDUSER.ASP

        'sUID = safestring(Request("uid"))
        'sVID = safestring(Request("vid"))

        '' --- CHECK FOR SU LOGGED IN
        'If aUserSession(cCOMPANY_ID) = "0" Then
        '    'USES CID PASSED IN FROM ADM_FINDUSER.ASP
        '    nCID = safestring(Request("cid"))
        '    'sVID = safestring(request("vid"))

        'Else
        '    'USES HARDCODED CID IN GLOBAL.ASA
        '    nCID = CInt(Application("CompanyID"))
        '    'sVID = sUID

        'End If
        'GetUserData()
    End Sub
    'Public Function GetUserData() As String()
    '--- EDIT USER STUFF
    'oUserData = Server.CreateObject("viaUserManagement.UserManagement")
    'oUserData.DBConnectString = Application("DSN")
    'Rs = oUserData.AddUserConfirm(sUID, sVID, nCID)
    'oUserData = Nothing
    ''--- STORE USER DATA
    'If Not Rs.EOF Then
    '    sUID = SafeString(Rs("User_ID"))
    '    sVID = SafeString(Rs("viaklix_id"))
    '    nCID = CInt(Rs("company_id"))
    '    company = safestring(Rs("company_name"))
    '    password = SafeString(Rs("password"))
    '    First_name = SafeString(Rs("First_name"))
    '    Last_name = SafeString(Rs("Last_name"))
    '    Location = SafeString(Rs("Location"))
    '    Phone = SafeString(Rs("Phone"))
    '    ext = SafeString(Rs("Ext"))
    '    Supervisor = SafeString(Rs("Supervisor"))
    '    Active = UCase(Trim(Rs("Active")))
    '    Email = SafeString(Rs("Email_Address"))
    '    RoleID = CInt(Rs("RoleID"))
    'End If

    'oLockStatus = Server.CreateObject("viaUserManagement.UserManagement")
    'oLockStatus.DBConnectString = Application("DSN")
    'bLockStatus = oLockStatus.LockedStatus(sUID, sVID, nCID)
    ''set oLockStatus = nothing
    'If bLockStatus Then
    '    Msg = "This account has been locked."
    'Else
    '    oLockStatus = Nothing
    'End If
    'End Function
    'Public Function DispSupervisor() As String
    'Dim sHTML As String
    '    if ((Supervisor = "") OR (sUID = aUserSession(cUSER_ID)) OR (sVID = "000000") OR (sVID = sUID)) then   %>
    '	<td colspan=2>
    '		<input type="hidden" name="supervisor" value="<%=Supervisor%>">
    '		<input type="hidden" name="supervisorold" value="<%=Supervisor%>">
    '	</td>   <%
    'else
    '	 %>
    '	<td>Supervisor : </td>
    '	<td>
    '		<%
    '    '--- IF EDITED USER IS AN 'E'
    '    If ((nCID <> 0) And (sVID <> sUID) And (sVID <> "000000")) Then
    '        oSupervisors = CreateObject("viaUserManagement.UserManagement")
    '        oSupervisors.DBConnectString = Application("DSN")
    '        aUsersSorted = oSupervisors.GetMerchantUsers(sVID, Supervisor)
    '        oSupervisors = Nothing


    '        If IsArray(aUsersSorted) Then
    '            sHTML = ""
    '            sHTML = sHTML & "<select name=""Supervisor"">" & vbCrLf

    '            '--- LOOPS THROUGH ARRAY FOR EACH ELEMENT
    '            '--- aUsersSorted(i,0) : CONTAINS THE UID OF EACH POTENTIAL SUPERVISOR
    '            '--- aUsersSorted(i,1) : CONTAINS UID OF SUPERVISOR OF PERSON SHOWN IN (i,0)
    '            '--- aUsersSorted(i,2) : CONTAINS AN 'ACCESS' FLAG -- NOT USED IN THIS CONTEXT
    '            '--- aUsersSorted(i,3) : CONTAINS A USER LEVEL FLAG
    '            '--------------------------------------------------------

    '            For i = 0 To UBound(aUsersSorted)
    '                If aUsersSorted(i, 0) = aUserSession(cUSER_ID) Then
    '                    LevelAdmin = safestring(aUsersSorted(i, 1))
    '                    Exit For
    '                End If
    '            Next

    '            If LevelAdmin = "" Then
    '                LevelAdmin = aUserSession(cUSER_ID)
    '            End If

    '            For i = 0 To UBound(aUsersSorted)
    '                If aUsersSorted(i, 0) = supervisor Then
    '                    AdminGroup = safestring(aUsersSorted(i, 1))
    '                    Exit For
    '                End If
    '            Next

    '            For i = 0 To UBound(aUsersSorted)
    '					sLevelMarker = string(aUsersSorted(i,3) * 3,"^")


    '                If (aUsersSorted(i, 0) <> sUID And safestring(aUsersSorted(i, 1)) <> sUID) Then
    '                    '--- IF ANY OF THE POTENTIAL SUPERVISORS MATCH THE CURRENT SUPERVISOR, THEN
    '                    '--- ADD TO DROP DOWN LIST AND MAKE IT THE DEFAULT, SELECTED SUPERVISOR.
    '                    '--- OTHERWISE, JUST ADD IT TO THE DROP DOWN LIST
    '                    If aUsersSorted(i, 0) = supervisor Then
    '                        sHTML = sHTML & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & "<option value=""" & aUsersSorted(i, 0) & """ selected>" & sLevelMarker & aUsersSorted(i, 0) & "</option>" & vbCrLf
    '                    Else
    '                        sHTML = sHTML & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & "<option value=""" & aUsersSorted(i, 0) & """>" & sLevelMarker & aUsersSorted(i, 0) & "</option>" & vbCrLf
    '                    End If
    '                End If

    '                sLevelMarker = ""
    '            Next

    '            sHTML = sHTML & vbTab & vbTab & vbTab & vbTab & vbTab & "</select>"
    '            sHTML = Replace(sHTML, "^", "&nbsp;")

    '            '--- END DROP DOWN LIST

    '            '--- IF ANYTHING WAS ADDED TO THE DROP DOWN LIST THEN DISPLAY THE LIST
    '            '--- OTHERWISE DISPLAY NOTHING
    '				response.write(sHTML) %>

    '			<input type="hidden" name="supervisorold" value="<%=Supervisor%>">
    '		<%
    '        Else
    '		%>
    '			<font face="verdana, arial, helvetica" size="2">Could not retrieve user list.</font>
    '			<input type="hidden" name="supervisor" value="<%=Supervisor%>">
    '			<input type="hidden" name="supervisorold" value="<%=Supervisor%>">
    '		<% end if %>
    '	</td>  <%
    '        End If
    '    End If
    'End Function
End Class
